﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
    xmlns:n="http://nRoute/schemas/2010/xaml"
	x:Class="nRoute.Samples.OfficerXcel.Views.NewDialog"
	d:DesignWidth="940" d:DesignHeight="480">
    
	<i:Interaction.Behaviors>
		<n:BridgeViewModelBehavior/>
	</i:Interaction.Behaviors>

	<Grid x:Name="LayoutRoot" HorizontalAlignment="Left">
        
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="*"/>
			<ColumnDefinition MaxWidth="335"/>
		</Grid.ColumnDefinitions>
        
        <!-- SIDE PANEL -->
		<Grid Grid.Column="1" MinWidth="335">
            
			<Border x:Name="SideBackground" Height="Auto" VerticalAlignment="Stretch" Background="#FFECF0F3" CornerRadius="0,8,8,0" 
                    d:IsLocked="True"/>
			
            <Border x:Name="SideShadow" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Stretch" Width="15" 
                    BorderBrush="#FFBDB8B8" BorderThickness="1,0,0,0">
				<Border.Background>
					<LinearGradientBrush EndPoint="0.848,0.712" StartPoint="0.161,0.712">
						<GradientStop Color="#FFE5E9EC" Offset="0.754"/>
						<GradientStop Color="#FFC7C8CA" Offset="0"/>
						<GradientStop Color="#00E5E9EC" Offset="1"/>
					</LinearGradientBrush>
				</Border.Background>
			</Border>
            
            <TextBlock Height="25" Margin="29,9,0,0" VerticalAlignment="Top" Text="{Binding ActiveTemplate.Title, Mode=OneWay}"
				TextWrapping="NoWrap" FontFamily="Arial" FontSize="14" HorizontalAlignment="Left" FontWeight="Bold"/>
            
            <!-- DETAILS CONTAINER -->
            <n:NavigationContainer Margin="10,25,10,20" 
                                        Url="{Binding ActiveTemplate.PanelUrl, Mode=TwoWay, UpdateSourceTrigger=Default}" >
            	<i:Interaction.Behaviors>
            		<n:NavigationHandlerBehavior HandlerName="SidePanelContainer"/>
            	</i:Interaction.Behaviors>
            </n:NavigationContainer>
            
        </Grid>
        
		<Grid Background="#FFFFFFFF" Margin="10,0,10,0">
			<Grid.RowDefinitions>
				<RowDefinition Height="72"/>
				<RowDefinition/>
			</Grid.RowDefinitions>
			<TextBlock Height="Auto" Margin="7,9,0,0" VerticalAlignment="Top" Text="Avaliable Templates"
				TextWrapping="NoWrap" FontFamily="Arial" FontSize="14" HorizontalAlignment="Left" FontWeight="Bold"/>
			<Path Fill="#FFFFFFFF" Stretch="Fill" Stroke="#FFC3C3C3" Height="1" Margin="6,31,6,0" VerticalAlignment="Top" 
				UseLayoutRounding="False" Data="M0,30 L587,30" StrokeDashOffset="39" StrokeDashArray="2 1" Width="Auto"/>
			<Grid Height="27" Margin="8,0,8,6" VerticalAlignment="Bottom" Background="#FFEEEFF1">
				<Ellipse Fill="#FFFFFFFF" HorizontalAlignment="Left" Margin="8,3,0,4" Width="20" StrokeThickness="1" Stroke="#FFBDC0C5"/>
				<Path Fill="#FFBDC0C5" Stretch="Fill" HorizontalAlignment="Left" Margin="12.057,8.057,0,9.542" Width="11.686" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" Data="M12.79541,4.2857876 L16.337402,4.2857876 L12.890625,7.7325649 L19.78418,7.7325649 L19.78418,10.239889 L12.890625,10.239889 L16.337402,13.686666 L12.79541,13.686666 L8.0981445,8.9830532 z">
					<Path.RenderTransform>
						<TransformGroup>
							<ScaleTransform/>
							<SkewTransform/>
							<RotateTransform/>
							<TranslateTransform/>
						</TransformGroup>
					</Path.RenderTransform>
				</Path>
				<Ellipse Stroke="#FFBDC0C5" Fill="#FFFFFFFF" StrokeThickness="1" HorizontalAlignment="Left" 
					Margin="32,3,0,4" Width="20"/>
				<Path Fill="#FFBDC0C5" Stretch="Fill" HorizontalAlignment="Left" Margin="36.537,8.057,0,9.542" Width="11.686" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" Data="M12.79541,4.2857876 L16.337402,4.2857876 L12.890625,7.7325649 L19.78418,7.7325649 L19.78418,10.239889 L12.890625,10.239889 L16.337402,13.686666 L12.79541,13.686666 L8.0981445,8.9830532 z">
					<Path.RenderTransform>
						<TransformGroup>
							<ScaleTransform ScaleX="-1"/>
							<SkewTransform/>
							<RotateTransform/>
							<TranslateTransform/>
						</TransformGroup>
					</Path.RenderTransform>
				</Path>
				<Image HorizontalAlignment="Left" Margin="66,4,0,7" Width="16" Source="../Icons/Home.png" Stretch="Fill" Height="16"/>
				<TextBlock HorizontalAlignment="Left" Margin="91,6,0,8" Width="56" Text="Home" 
					TextWrapping="Wrap" FontSize="13" FontFamily="Arial"/>
			</Grid>
            
			<!-- LISTBOX 1 - Offline Doc Templates -->
			<ListBox Height="125" Margin="8,0" VerticalAlignment="Top" Grid.Row="1" 
				BorderBrush="#FFEDEEF0" ItemsSource="{Binding LocalDocumentTemplates}" 
				Style="{StaticResource DocumentTemplatesListBoxStyle}" 
				ItemTemplate="{StaticResource DocumentTemplateTemplate}" 
				ItemsPanel="{StaticResource DocumentTemplatesItemsPanelTemplate}" 
				ItemContainerStyle="{StaticResource DocumentTemplateItemContainerStyle}"
				x:Name="LocalTemplatesListBox"                
				SelectedItem="{Binding LocalSelectedTemplate, Mode=TwoWay}">
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="SelectionChanged">
						<n:ExecuteCommandAction Command="{Binding LocalTemplateSelectionCommand, Mode=OneWay}"/>
						<!--<n:NavigateAction HandlerName="SidePanelContainer" 
							Url="{Binding SelectedItem.PanelUrl, ElementName=LocalTemplatesListBox, Mode=OneWay}"/> -->									
					</i:EventTrigger>
				</i:Interaction.Triggers>
			</ListBox>

            <!-- TITLE AND SEARCH BAR -->
			<Grid Height="27" Margin="8,142,8,0" VerticalAlignment="Top" Background="#FFEEEFF1" Grid.Row="1">
                
				<Rectangle Fill="#FFFFFFFF" HorizontalAlignment="Right" Margin="0,3,13,4" Width="20" 
					StrokeThickness="1" Stroke="#FFBDC0C5" Cursor="Hand"/>
				<Path Fill="#FFBDC0C5" Stretch="Fill" HorizontalAlignment="Right" Margin="0,0,16.829,0" 
					Width="11.686" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" 
					Data="M12.79541,4.2857876 L16.337402,4.2857876 L12.890625,7.7325649 L19.78418,7.7325649 L19.78418,10.239889 L12.890625,10.239889 L16.337402,13.686666 L12.79541,13.686666 L8.0981445,8.9830532 z" 
					VerticalAlignment="Center" Height="10">
					<Path.RenderTransform>
						<TransformGroup>
							<ScaleTransform ScaleX="-1"/>
							<SkewTransform/>
							<RotateTransform/>
							<TranslateTransform/>
						</TransformGroup>
					</Path.RenderTransform>
				</Path>
                
				<TextBlock HorizontalAlignment="Left" Margin="13,6,100,8" Width="Auto" 
					TextWrapping="NoWrap" FontSize="13" FontFamily="Arial" Text="Office Online Templates"/>
				<TextBox HorizontalAlignment="Right" Margin="0,3,39,3" Width="250" Text="Search for Online Templates" 
					TextWrapping="Wrap" Height="Auto" VerticalAlignment="Center" FontSize="10.5" BorderBrush="#FFBDC0C5" 
					Foreground="#FF333333"/>
                
			</Grid>
             
			<!-- LISTBOX 2 - Online Doc Templates -->
			<ListBox x:Name="OnlineTemplatesListBox" Margin="8,176,8,12" VerticalAlignment="Stretch" Grid.Row="1" 
				BorderBrush="#FFEDEEF0" ItemsSource="{Binding OnlineDocumentTemplates}" 
				Style="{StaticResource DocumentTemplatesListBoxStyle}" 
				ItemTemplate="{StaticResource DocumentTemplateTemplate}" 
				ItemsPanel="{StaticResource DocumentTemplatesItemsPanelTemplate}" 
				ItemContainerStyle="{StaticResource DocumentTemplateItemContainerStyle}"                
				SelectedItem="{Binding OnlineSelectedTemplate, Mode=TwoWay}">
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="SelectionChanged">
						<n:ExecuteCommandAction Command="{Binding OnlineTemplateSelectionCommand, Mode=OneWay}"/>
						<!--<n:NavigateAction HandlerName="SidePanelContainer" 
							Url="{Binding SelectedItem.PanelUrl, ElementName=OnlineTemplatesListBox, Mode=OneWay}"/>-->
					</i:EventTrigger>
				</i:Interaction.Triggers>
			</ListBox>
		</Grid>
	</Grid>
</UserControl>